import routerMap from './router.map'
import { parseRoutes } from '@/utils/routerUtil'

// 异步路由配置
const routesConfig = [
  {
    path: '/',
    name: '首页',
    redirect: '/login',
  },
  {
    path: '/login',
    name: '登录页',
    component: () =>
      import('@/pages/login')
  },
  {
    path: '*',
    name: '404',
    component: () =>
      import('@/pages/exception/404'),
  },
  {
    path: '/403',
    name: '403',
    component: () =>
      import('@/pages/exception/403'),
  }
]

const options = {
  routes: parseRoutes(routesConfig, routerMap)
}

export default options
